import { useAppDispatch, useAppSelector } from '@/app/hooks';
import { add } from '@/app/slices/countSlice';
import React from 'react'
// import {useSelector, useDispatch} from 'react-redux';

export default function ReduxCom() {
  //获取状态值
  let count = useAppSelector(state => state.value);
  //获取 dispatch
  let dispatch = useAppDispatch();
  return (
    <div>
      当前的计数为: {count}
      <hr />
      <button onClick={() => {
        dispatch(add(1));
      }}>新增</button>
    </div>
  )
}
